class CreateErrortimes < ActiveRecord::Migration
  def self.up
    create_table :errortimes do |t|
      t.integer       :errortime,     :default => 10                            #误差时间
      t.integer       :is_locked     ,:limit => 1 ,:default => 0                #锁定 1为True 0为False
      t.integer       :lock_version  ,:default => 0                             #乐观锁
      t.timestamps
    end
    Errortime.create(:errortime => 15)
  end

  def self.down
    drop_table :errortimes
  end
end
